import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { InsCompanyVO, InsCompanyForm, InsCompanyQuery } from '@/api/bzIns/insCompany/types';

/**
 * 查询保险公司信息列表
 * @param query
 * @returns {*}
 */

export const listInsCompany = (query?: InsCompanyQuery): AxiosPromise<InsCompanyVO[]> => {
  return request({
    url: '/bzIns/insCompany/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询保险公司信息详细
 * @param insCompanyId
 */
export const getInsCompany = (insCompanyId: string | number): AxiosPromise<InsCompanyVO> => {
  return request({
    url: '/bzIns/insCompany/' + insCompanyId,
    method: 'get'
  });
};

/**
 * 新增保险公司信息
 * @param data
 */
export const addInsCompany = (data: InsCompanyForm) => {
  return request({
    url: '/bzIns/insCompany',
    method: 'post',
    data: data
  });
};

/**
 * 修改保险公司信息
 * @param data
 */
export const updateInsCompany = (data: InsCompanyForm) => {
  return request({
    url: '/bzIns/insCompany',
    method: 'put',
    data: data
  });
};

/**
 * 删除保险公司信息
 * @param insCompanyId
 */
export const delInsCompany = (insCompanyId: string | number | Array<string | number>) => {
  return request({
    url: '/bzIns/insCompany/' + insCompanyId,
    method: 'delete'
  });
};
